Analysis date: 2020-01-10

Setup

Load libraries

library(plyr)
library(gtools)
library(openxlsx)
library(pheatmap)
library(reshape2)
library(progress)
library(Matrix)
library(Hmisc)
library(lemon)
library(ggpubr)
library(effsize)
library(ggbeeswarm)
library(ggfortify)
library(ggpmisc)
library(ggrepel)
library(readxl)
library(DESeq2)
library(TOSTER)
library(tidyverse)
library(vsn)
library(fdrtool)
library(limma)
library(apeglm)
library(IHW)
library(Rtsne)
library(biomartr)
library(biomaRt)
library(MultiAssayExperiment)
library(PMA)
library(gplots)
library(RColorBrewer)
library(grid)
library(ConsensusClusterPlus)
library(survival)
library(survminer)
library(cowplot)
library(viridis)

Load data

source("/Volumes/sd17b003/Sophie/Analysis/Screen_analysis/Figure_layouts.R")
load("/Volumes/sd17b003/Sophie/Analysis/CLL_Proteomics/CLL_Proteomics_final/Proteomics_Git/Robjects/CLL_Proteomics_Setup.RData")
load("/Volumes/sd17b003/Sophie/Analysis/CLL_Proteomics/CLL_Proteomics_final/Proteomics_Git/Robjects/CLL_Proteomics_ConsensusClustering.RData")
load("/Volumes/sd17b003/Sophie/Analysis/CLL_Proteomics/R_objects/GOterm_BCR.RData")
load("/Volumes/sd17b003/Sophie/Analysis/CLL_Proteomics/R_objects/GOterm_Spliceosome.RData")
colData(multiomics_MAE)$PG <- as.factor(CCP_group5[rownames(colData(multiomics_MAE))])
colData(multiomics_MAE)$CCP6_RNA <- as.factor(CCP_group6_RNA[rownames(colData(multiomics_MAE))])

Analysis

Dimension reduction plots

tsne (Barnes-Hut-SNE)

t-SNE colored by genetic alterations and groups

set.seed(10)
rtsne_out <- Rtsne( t(assay(multiomics_MAE[prot_few_nas , ,"proteomics"])), perplexity = 10 )
rtsne_out_df <- rtsne_out$Y %>% as.data.frame() %>% as_tibble()
rtsne_out_df$pat_ID <- colnames(assay(multiomics_MAE[prot_few_nas , ,"proteomics"]))

rtsne_out_df <- left_join(rtsne_out_df, 
                          wideFormat(multiomics_MAE[, ,c("SNPs","chrom_abber", "health_record_bin") ], colDataCols = c("gender", "treatment_status", "doehner_groups", "PG")) %>% as_tibble(), 
                          by=c("pat_ID"="primary") )

rtsne_out_df <- mutate_at(rtsne_out_df, colnames(rtsne_out_df %>% dplyr::select(SNPs_ATM:health_record_bin_treated)), as.logical)
rtsne_out_df <- rtsne_out_df %>% replace(is.na(.), "unknown")

message("t-SNE colored by Döhner groups")
ggplot(rtsne_out_df, aes(V1, V2)) +
  geom_point(aes(color=doehner_groups), size=3) +
  pp_sra +
  theme(aspect.ratio=1, plot.title = element_text(size = 30))

message("t-SNE colored by consensus cluster groups")
tsne_CCP_P_plot <-  ggplot(rtsne_out_df, aes(V1, V2)) +
  geom_point(aes(fill=PG), color="grey", shape=21) +
  scale_fill_manual(values = colors_CCP)+
  pp_sra +
  guides(color=guide_legend(title="PG")) 
tsne_CCP_P_plot+  theme(aspect.ratio=1, plot.title = element_text(size = 30))

message("t-SNE colored by combination of IGHV status and trisomy12")
tsne_IGHVtris_plot <- ggplot(rtsne_out_df %>% filter(health_record_bin_IGHV_mutated!="unknown", chrom_abber_trisomy12!="unknown"), aes(V1, V2)) +
  geom_point(aes(fill=interaction(health_record_bin_IGHV_mutated, chrom_abber_trisomy12)), color="grey", shape=21) +
  scale_fill_manual(values = colors_CCP[c(1,3,4,2)] )+
  pp_sra_noguides 
tsne_IGHVtris_plot +  theme(aspect.ratio=1, plot.title = element_text(size = 30)) #+

message("t-SNE colored by IGHV status")
ggplot(rtsne_out_df, aes(V1, V2)) +
          geom_point(aes_string(color="health_record_bin_IGHV_mutated"), size=3) +
    scale_color_manual(values = c( "#0571b0", "#ca0020", "grey"))  + 
      pp_sra +
      theme(aspect.ratio=1, plot.title = element_text(size = 30))+
  guides(color=guide_legend(title="IGHV_mutated"))

message("t-SNE colored by trisomy12")
ggplot(rtsne_out_df, aes(V1, V2)) +
          geom_point(aes_string(color="chrom_abber_trisomy12"), size=3) +
    scale_color_manual(values = c( "#0571b0", "#ca0020", "grey"))  + 
      pp_sra +
      theme(aspect.ratio=1, plot.title = element_text(size = 30))+
  guides(color=guide_legend(title="trisomy12"))

sapply(colnames(rtsne_out_df)[c(4,5,8:29)], function(var){
  print(ggplot(rtsne_out_df, aes(V1, V2)) +
          geom_point(aes_string(color=var), size=3) +
    scale_color_manual(values = c( "#0571b0", "#ca0020", "grey"))  + 
          ggtitle(gsub("SNPs_", "", gsub("chrom_abber_", "", gsub( "health_record_bin_", "", var) ))) +
      pp_sra_noguides +
      theme(aspect.ratio=1, plot.title = element_text(size = 30)) )
})

##             gender  treatment_status SNPs_ATM SNPs_BIRC3 SNPs_EGR2 SNPs_NOTCH1
## data        List,29 List,29          List,29  List,29    List,29   List,29    
## layers      List,1  List,1           List,1   List,1     List,1    List,1     
## scales      ?       ?                ?        ?          ?         ?          
## mapping     List,2  List,2           List,2   List,2     List,2    List,2     
## theme       List,66 List,66          List,66  List,66    List,66   List,66    
## coordinates ?       ?                ?        ?          ?         ?          
## facet       ?       ?                ?        ?          ?         ?          
## plot_env    ?       ?                ?        ?          ?         ?          
## labels      List,4  List,4           List,4   List,4     List,4    List,4     
## guides      List,4  List,4           List,4   List,4     List,4    List,4     
##             SNPs_POT1 SNPs_SF3B1 SNPs_TP53 SNPs_XPO1 chrom_abber_del11q
## data        List,29   List,29    List,29   List,29   List,29           
## layers      List,1    List,1     List,1    List,1    List,1            
## scales      ?         ?          ?         ?         ?                 
## mapping     List,2    List,2     List,2    List,2    List,2            
## theme       List,66   List,66    List,66   List,66   List,66           
## coordinates ?         ?          ?         ?         ?                 
## facet       ?         ?          ?         ?         ?                 
## plot_env    ?         ?          ?         ?         ?                 
## labels      List,4    List,4     List,4    List,4    List,4            
## guides      List,4    List,4     List,4    List,4    List,4            
##             chrom_abber_del13q14 chrom_abber_del17p13 chrom_abber_del5_IgH
## data        List,29              List,29              List,29             
## layers      List,1               List,1               List,1              
## scales      ?                    ?                    ?                   
## mapping     List,2               List,2               List,2              
## theme       List,66              List,66              List,66             
## coordinates ?                    ?                    ?                   
## facet       ?                    ?                    ?                   
## plot_env    ?                    ?                    ?                   
## labels      List,4               List,4               List,4              
## guides      List,4               List,4               List,4              
##             chrom_abber_delIgH_break chrom_abber_gain14q32 chrom_abber_gain8q24
## data        List,29                  List,29               List,29             
## layers      List,1                   List,1                List,1              
## scales      ?                        ?                     ?                   
## mapping     List,2                   List,2                List,2              
## theme       List,66                  List,66               List,66             
## coordinates ?                        ?                     ?                   
## facet       ?                        ?                     ?                   
## plot_env    ?                        ?                     ?                   
## labels      List,4                   List,4                List,4              
## guides      List,4                   List,4                List,4              
##             chrom_abber_trisomy12 health_record_bin_elderly_at_diagnosis
## data        List,29               List,29                               
## layers      List,1                List,1                                
## scales      ?                     ?                                     
## mapping     List,2                List,2                                
## theme       List,66               List,66                               
## coordinates ?                     ?                                     
## facet       ?                     ?                                     
## plot_env    ?                     ?                                     
## labels      List,4                List,4                                
## guides      List,4                List,4                                
##             health_record_bin_elderly_patient health_record_bin_gender_binary
## data        List,29                           List,29                        
## layers      List,1                            List,1                         
## scales      ?                                 ?                              
## mapping     List,2                            List,2                         
## theme       List,66                           List,66                        
## coordinates ?                                 ?                              
## facet       ?                                 ?                              
## plot_env    ?                                 ?                              
## labels      List,4                            List,4                         
## guides      List,4                            List,4                         
##             health_record_bin_IGHV_mutated
## data        List,29                       
## layers      List,1                        
## scales      ?                             
## mapping     List,2                        
## theme       List,66                       
## coordinates ?                             
## facet       ?                             
## plot_env    ?                             
## labels      List,4                        
## guides      List,4                        
##             health_record_bin_komplex_abberant_karyotype
## data        List,29                                     
## layers      List,1                                      
## scales      ?                                           
## mapping     List,2                                      
## theme       List,66                                     
## coordinates ?                                           
## facet       ?                                           
## plot_env    ?                                           
## labels      List,4                                      
## guides      List,4                                      
##             health_record_bin_treated
## data        List,29                  
## layers      List,1                   
## scales      ?                        
## mapping     List,2                   
## theme       List,66                  
## coordinates ?                        
## facet       ?                        
## plot_env    ?                        
## labels      List,4                   
## guides      List,4
message("There is are trisomy12 negative patients which clusters with all of the other trisomy12 patients. Does they have a subclonal mutations?")
metadata(multiomics_MAE)$fish_df_clonsizes["trisomy12" ,] %>% 
  dplyr::select(rtsne_out_df %>% filter(chrom_abber_trisomy12==FALSE) %>% arrange(desc(V1)) %>% slice(1:2) %>% .$pat_ID)

BCR signaling

Different kinds of plots

BCR_genes_mean <- assay(multiomics_MAE[BCR_genes$symbol, ,"proteomics"]) %>% colMeans(na.rm = TRUE) %>% enframe()
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
BCR_CCP_P_plot <- left_join(BCR_genes_mean, 
          enframe(multiomics_MAE$PG, value = "PG"), 
          by=c("name")) %>%
  filter(!is.na(PG)) %>%
  ggplot(aes( PG, value ))+
  geom_boxplot(aes(fill=PG)) + geom_beeswarm() + 
  ggtitle("BCR protein abundance") + 
  scale_fill_manual(values=colors_CCP) +
  pp_sra +
  ylab("Mean abundance of BCR proteins")+
  #theme(legend.position = "bottom") +
  stat_compare_means(label = "p.signif", method = "t.test",
                     ref.group = ".all.", label.y = 0.2, hide.ns = TRUE) +
  guides(fill=guide_legend(title="PG"))
BCR_CCP_P_plot + theme(aspect.ratio=1) + 
  stat_compare_means(method = "anova", label.y = 0.22, hjust=0)

Heatmaps

Selected BCR proteins

# Smaller heatmap with only selected proteins
#sel_BCR <- c("ZAP70",  "IGHM", "CD79A", "CD79B", "LYN",  "SYK", "BLNK", "PLCG2",  "BTK",  "PTPN6", "NFATC2", 
#             "MAPK1", "MAP2K2", "NRAS", "MALT1", "BCL10", "PIK3CD","CD19",  "VAV3",
#             "AKT1", "IKBKB")

sel_BCR <- c("ZAP70",  "IGHM", "CD79A", "CD79B",  "SYK", "PLCG2",  "BTK",  "PTPN6", 
             "MAPK1",  "PIK3CD", "AKT1", "IKBKB")

tmp_BCR <- wideFormat(multiomics_MAE[sel_BCR, ,"proteomics"], colDataCols = c("PG", "IGHV" )) %>% 
  as_tibble()
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
tmp_BCR_mx <- tmp_BCR %>% dplyr::select(-primary, -PG, -IGHV) %>% as.matrix()
rownames(tmp_BCR_mx) <- tmp_BCR$primary
colnames(tmp_BCR_mx) <- gsub("proteomics_", "", colnames(tmp_BCR_mx))
tmp_BCR_anno <- tmp_BCR[, c("PG", "IGHV")] %>% as.data.frame()
rownames(tmp_BCR_anno) <- tmp_BCR$primary
tmp_BCR_anno$IGHV[tmp_BCR_anno$IGHV=="U"] <- "U-CLL"
tmp_BCR_anno$IGHV[tmp_BCR_anno$IGHV=="M"] <- "M-CLL"

ann_colors = list(
  PG=c("1"= colors_CCP[1], "2"= colors_CCP[2], "3"= colors_CCP[3], "4"= colors_CCP[4], "5"= colors_CCP[5], "6"= colors_CCP[6] ),
  IGHV=c("U-CLL"= "#0571b0", "M-CLL"= "#ca0020"))

tmp_BCR_anno$PG <- factor(tmp_BCR_anno$PG, levels = c(1:3,5,6,4))

breaks= seq(min(tmp_BCR_mx), max(tmp_BCR_mx), 0.1)^2
breaks= sort(c(-breaks, breaks))
breaks <- breaks[! (breaks < min(tmp_BCR_mx) | breaks > max(tmp_BCR_mx) )]

pat_order_hclust <- sapply(c(1:3,5,6,4), function(P){
  hc <- hclust(dist(tmp_BCR_mx[rownames(tmp_BCR_anno[tmp_BCR_anno$PG==P,]), ] ))
  hc$labels[hc$order]
}) %>% unlist

PG_BCR_proteins_pheatmap <- pheatmap(t(tmp_BCR_mx[pat_order_hclust, ]), 
         annotation_col = tmp_BCR_anno, annotation_colors = ann_colors, scale = "row", cluster_cols = FALSE, 
         color = inferno(length(breaks)), border_color = NA, 
         gaps_col = (which(!tmp_BCR_anno %>% rownames_to_column() %>% arrange(PG, IGHV) %>% .$PG %>% duplicated())-1)[-1],  
         breaks = breaks , cutree_rows = 4, show_colnames = F, treeheight_row = 0, fontsize_row = 5)

GO terms B-cell activation or BCR signaling combined

tmp_BCR_GO <- wideFormat(multiomics_MAE[unique(c(GO_BC_activation$hgnc_symbol, GO_BCR$hgnc_symbol)), ,"proteomics"], colDataCols = c("PG", "IGHV" )) %>% 
  as_tibble()
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
tmp_BCR_GO_mx <- tmp_BCR_GO %>% dplyr::select(-primary, -PG, -IGHV) %>% as.matrix()
rownames(tmp_BCR_GO_mx) <- tmp_BCR_GO$primary
colnames(tmp_BCR_GO_mx) <- gsub("proteomics_", "", colnames(tmp_BCR_GO_mx))
tmp_BCR_GO_anno <- tmp_BCR_GO[, c("PG", "IGHV")] %>% as.data.frame()
rownames(tmp_BCR_GO_anno) <- tmp_BCR_GO$primary
tmp_BCR_GO_anno$PG <- factor(tmp_BCR_GO_anno$PG, levels = c(1:3,5,6,4))

ann_colors = list(
  PG=c("1"= colors_CCP[1], "2"= colors_CCP[2], "3"= colors_CCP[3], "4"= colors_CCP[4], "5"= colors_CCP[5], "6"= colors_CCP[6] ))

breaks= seq(min(tmp_BCR_GO_mx), max(tmp_BCR_GO_mx), 0.1)^2
breaks= sort(c(-breaks, breaks))
breaks <- breaks[! (breaks < min(tmp_BCR_GO_mx) | breaks > max(tmp_BCR_GO_mx) )]

message("Heatmap of abundance BCR signaling proteins ordered according to PG")
## Heatmap of abundance BCR signaling proteins ordered according to PG
PG_BCR_pheatmap <- pheatmap(t(tmp_BCR_GO_mx[(tmp_BCR_GO_anno %>% rownames_to_column() %>% arrange(PG, IGHV) %>% .$rowname), ]), 
         annotation_col = tmp_BCR_GO_anno, annotation_colors = ann_colors, scale = "row", cluster_cols = FALSE, 
         color = inferno(length(breaks)), border_color = NA, 
         gaps_col = (which(!tmp_BCR_GO_anno %>% rownames_to_column() %>% arrange(PG, IGHV) %>% .$PG %>% duplicated())-1)[-1],
         breaks = breaks , cutree_rows = 3, show_colnames = F, treeheight_row = 0, fontsize_row = 5)

Spliceosome

KEGG

splice_genes_mean <- assay(multiomics_MAE[splice_genes$symbol, ,"proteomics"]) %>% colMeans(na.rm = TRUE) %>% enframe()
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
splicing_CCP_P_plot <- left_join(splice_genes_mean, 
          enframe(multiomics_MAE$PG, value = "PG"), 
          by=c("name")) %>%
  filter(!is.na(PG)) %>%
  ggplot(aes( PG, value ))+
  geom_boxplot(aes(fill=PG)) + geom_beeswarm() + 
  ggtitle("Spliceosome protein abundance") + 
  pp_sra +
  ylab("Mean abundance of spliceosome proteins")+
  stat_compare_means(label = "p.signif", method = "t.test",
                     ref.group = ".all.", label.y = 0.2, hide.ns = TRUE)+
  guides(fill=guide_legend(title="PG")) +
  scale_fill_manual(values = colors_CCP)
splicing_CCP_P_plot +   theme(aspect.ratio=1) + 
    stat_compare_means(method = "anova", label.y = 0.22, hjust=0)

GO term Spliceosomal complex

tmp_Splice_GO <- wideFormat(multiomics_MAE[GO_SpliceosomalComplex$hgnc_symbol, ,"proteomics"], colDataCols = c("PG", "IGHV" )) %>% 
  as_tibble()
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
tmp_Splice_GO_mx <- tmp_Splice_GO %>% dplyr::select(-primary, -PG, -IGHV) %>% as.matrix()
rownames(tmp_Splice_GO_mx) <- tmp_Splice_GO$primary
colnames(tmp_Splice_GO_mx) <- gsub("proteomics_", "", colnames(tmp_Splice_GO_mx))
tmp_Splice_GO_anno <- tmp_Splice_GO[, c("PG", "IGHV")] %>% as.data.frame()
rownames(tmp_Splice_GO_anno) <- tmp_Splice_GO$primary
tmp_Splice_GO_anno$PG <- factor(tmp_Splice_GO_anno$PG,levels = c(1:3,5,6,4))

ann_colors = list(
  PG=c("1"= colors_CCP[1], "2"= colors_CCP[2], "3"= colors_CCP[3], "4"= colors_CCP[4], "5"= colors_CCP[5], "6"= colors_CCP[6] ))

breaks= seq(min(tmp_Splice_GO_mx), max(tmp_Splice_GO_mx), 0.1)^2
breaks= sort(c(-breaks, breaks))
breaks <- breaks[! (breaks < min(tmp_Splice_GO_mx) | breaks > max(tmp_Splice_GO_mx) )]

message("Heatmap of abundance spliceosome proteins ordered according to PG")
## Heatmap of abundance spliceosome proteins ordered according to PG
PG_GOSplice_pheatmap <- pheatmap(t(tmp_Splice_GO_mx[(tmp_Splice_GO_anno %>% rownames_to_column() %>% arrange(PG, IGHV) %>% .$rowname), ]), 
         annotation_col = tmp_Splice_GO_anno, annotation_colors = ann_colors, scale = "row", cluster_cols = FALSE, 
         color =  inferno(length(breaks)), border_color = NA, 
         gaps_col = (which(!tmp_Splice_GO_anno %>% rownames_to_column() %>% arrange(PG, IGHV) %>% .$PG %>% duplicated())-1)[-1],
         breaks = breaks , show_colnames = F , treeheight_row = 0, fontsize_row = 2)

Selected spliceosome proteins

some_spliceprots <- c("SF3B1", "SNRPA", "PRPF6", "PRPF3", "SF3A1", "SNRPD2",  "SRSF4", "CDC5L", "PRPF19",
                      "CRNKL1", "PUF60", "PRPF8",
                      "SNRPB2")

tmp_Splice_GO <- wideFormat(multiomics_MAE[some_spliceprots, ,"proteomics"], colDataCols = c("PG", "IGHV" )) %>% 
  as_tibble()
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
tmp_Splice_GO_mx <- tmp_Splice_GO %>% dplyr::select(-primary, -PG, -IGHV) %>% as.matrix()
rownames(tmp_Splice_GO_mx) <- tmp_Splice_GO$primary
colnames(tmp_Splice_GO_mx) <- gsub("proteomics_", "", colnames(tmp_Splice_GO_mx))
tmp_Splice_GO_anno <- tmp_Splice_GO[, c("PG", "IGHV")] %>% as.data.frame()
rownames(tmp_Splice_GO_anno) <- tmp_Splice_GO$primary
tmp_Splice_GO_anno$PG <- factor(tmp_Splice_GO_anno$PG,levels = c(1:3,5,6,4))
SF3B1mut <- wideFormat(multiomics_MAE["SF3B1",,"SNPs"])$SNPs_SF3B1
## harmonizing input:
##   removing 1 colData rownames not in sampleMap 'primary'
names(SF3B1mut) <- wideFormat(multiomics_MAE["SF3B1",,"SNPs"])$primary
## harmonizing input:
##   removing 1 colData rownames not in sampleMap 'primary'
tmp_Splice_GO_anno$SF3B1 <- as.factor(SF3B1mut[rownames(tmp_Splice_GO_anno)])
tmp_Splice_GO_anno$IGHV[tmp_Splice_GO_anno$IGHV=="U"] <- "U-CLL"
tmp_Splice_GO_anno$IGHV[tmp_Splice_GO_anno$IGHV=="M"] <- "M-CLL"

ann_colors = list(
  PG=c("1"= colors_CCP[1], "2"= colors_CCP[2], "3"= colors_CCP[3], "4"= colors_CCP[4], "5"= colors_CCP[5], "6"= colors_CCP[6] ),
  SF3B1=c("1"="darkblue", "0"="gray80"),
  IGHV=c("U-CLL"= "#0571b0", "M-CLL"= "#ca0020"))

pat_order_hclust_splice <- sapply(c(1:3,5,6,4), function(P){
  hc <- hclust(dist(tmp_Splice_GO_mx[rownames(tmp_Splice_GO_anno[tmp_Splice_GO_anno$PG==P,]), ] ))
  hc$labels[hc$order]
}) %>% unlist

PG_splice_proteins_pheatmap <- pheatmap(t(tmp_Splice_GO_mx[pat_order_hclust_splice, ]), 
         annotation_col = tmp_Splice_GO_anno, annotation_colors = ann_colors, scale = "row", cluster_cols = FALSE, 
         color =  inferno(length(breaks)), border_color = NA, 
         gaps_col = (which(!tmp_Splice_GO_anno %>% rownames_to_column() %>% arrange(PG, IGHV) %>% .$PG %>% duplicated())-1)[-1],
         breaks = breaks , show_colnames = F , treeheight_row = 0, fontsize_row = 5)

PCA

prot_pca <- prcomp(t( assay(multiomics_MAE[prot_few_nas , ,"proteomics"]) ))
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
prot_pca_x <- as_tibble(prot_pca$x[,1:10])
prot_pca_x$pat_ID <- colnames(assay(multiomics_MAE[prot_few_nas , ,"proteomics"]))
## harmonizing input:
##   removing 13 colData rownames not in sampleMap 'primary'
prot_pca_x <- left_join(prot_pca_x, 
                        wideFormat(multiomics_MAE[, ,c("SNPs","chrom_abber", "health_record_bin") ], 
                                   colDataCols = c("gender", "treatment_status", "PG")) %>% as_tibble() , 
                        by=c("pat_ID"="primary") )
## ExperimentList contains data.frame or DataFrame,
##   potential for errors with mixed data types
prot_pca_x <- prot_pca_x %>% replace(is.na(.), "unknown")

ggplot(prot_pca_x, aes(PC1, PC2)) +
  geom_point(aes(color=health_record_bin_IGHV_mutated, shape=chrom_abber_trisomy12)) + pp_sra +
  scale_shape_manual(values = c( 16,  1, 4)) + 
  scale_color_manual(values = c( "#0571b0","#ca0020", "grey")) + theme(aspect.ratio = 1)

ggplot(prot_pca_x, aes(PC1, PC3)) +geom_point(aes(color=health_record_bin_IGHV_mutated, shape=chrom_abber_trisomy12)) +
  scale_shape_manual(values = c( 16,  1, 4)) + 
  scale_color_manual(values = c( "#0571b0","#ca0020", "grey"))+ pp_sra+ theme(aspect.ratio = 1)

ggplot(prot_pca_x, aes(PC2, PC3)) +geom_point(aes(color=health_record_bin_IGHV_mutated, shape=chrom_abber_trisomy12)) +  
  scale_shape_manual(values = c( 16,  1, 4)) + 
  scale_color_manual(values = c( "#0571b0", "#ca0020", "grey")) + pp_sra+ theme(aspect.ratio = 1)

ggplot(prot_pca_x, aes(PC1, PC2)) +geom_point(aes(color=gender)) + pp_sra + scale_color_manual(values = c( "#0571b0","#ca0020", "grey")) + theme(aspect.ratio = 1)

PCA_CCP_1_2 <- ggplot(prot_pca_x, aes(PC1, PC2)) +
  geom_point(aes(fill=PG),shape=21, color="grey") + pp_sra  +
  guides(color=guide_legend(title="PG")) +
  scale_fill_manual(values = colors_CCP) 
PCA_CCP_1_2 +
  theme(aspect.ratio=1, plot.title = element_text(size = 30))

PCA_CCP_1_3 <- ggplot(prot_pca_x, aes(PC1, PC3)) +
  geom_point(aes(fill=PG),shape=21, color="grey") + pp_sra  +
  guides(color=guide_legend(title="PG")) +
  scale_fill_manual(values = colors_CCP) 
PCA_CCP_1_3 +
  theme(aspect.ratio=1, plot.title = element_text(size = 30))

PCA_CCP_2_3 <- ggplot(prot_pca_x, aes(PC2, PC3)) +
  geom_point(aes(fill=PG),shape=21, color="grey") + pp_sra  +
  guides(color=guide_legend(title="PG")) +
  scale_fill_manual(values = colors_CCP) 
PCA_CCP_2_3 +
  theme(aspect.ratio=1, plot.title = element_text(size = 30))

PCA_CCP_1_4 <- ggplot(prot_pca_x, aes(PC1, PC4)) +
  geom_point(aes(fill=PG),shape=21, color="grey") + pp_sra  +
  guides(color=guide_legend(title="PG")) +
  scale_fill_manual(values = colors_CCP) 
PCA_CCP_1_4 +
  theme(aspect.ratio=1, plot.title = element_text(size = 30))

tsne RNA

genes_no_nas <- multiomics_MAE[["RNAseq_norm"]] %>% is.na() %>% rowSums()
genes_no_nas <- genes_no_nas[ genes_no_nas == 0 ] %>% names()

set.seed(10)
rtsne_out_RNA <- Rtsne( t(assay(multiomics_MAE[genes_no_nas , ,"RNAseq_norm"])), perplexity = 10 )
rtsne_out_RNA_df <- rtsne_out_RNA$Y %>% as.data.frame() %>% as_tibble()
rtsne_out_RNA_df$pat_ID <- colnames(assay(multiomics_MAE[genes_no_nas , ,"RNAseq_norm"]))

rtsne_out_RNA_df <- left_join(rtsne_out_RNA_df, 
                          (wideFormat(multiomics_MAE[, ,c("SNPs","chrom_abber", "health_record_bin") ], colDataCols = c("gender", "treatment_status", "doehner_groups", "PG", "CCP6_RNA")) %>% as_tibble()), 
                          by=c("pat_ID"="primary") )

rtsne_out_RNA_df <- mutate_at(rtsne_out_RNA_df, colnames(rtsne_out_RNA_df %>% dplyr::select(SNPs_ATM:health_record_bin_treated)), as.logical)

rtsne_out_RNA_df <- rtsne_out_RNA_df %>% replace(is.na(.), "unknown")
## Warning in `[<-.factor`(`*tmp*`, thisvar, value = "unknown"): invalid factor
## level, NA generated
ggplot(rtsne_out_RNA_df, aes(V1, V2)) +
  geom_point(aes(color=doehner_groups), size=3) +
  scale_color_manual(values = c("#377eb8","#e41a1c", "#984ea3", "#4daf4a", "#ff7f00", "grey"))+
  pp_sra +
  theme(aspect.ratio=1, plot.title = element_text(size = 30))

tsne_CCP_R_plot <- ggplot(rtsne_out_RNA_df, aes(V1, V2)) +
  geom_point(aes(fill=PG), color="grey", shape=21) +
  scale_fill_manual(values = colors_CCP)+
  pp_sra +
  guides(color=guide_legend(title="PG"))
tsne_CCP_R_plot + theme(aspect.ratio=1, plot.title = element_text(size = 30))

tsne_CCPRNA_R_plot <- ggplot(rtsne_out_RNA_df, aes(V1, V2)) +
  geom_point(aes(fill=CCP6_RNA), color="grey", shape=21) +
  scale_color_hue()+
  pp_sra +
  guides(color=guide_legend(title="CC_RNA"))
tsne_CCPRNA_R_plot+  theme(aspect.ratio=1, plot.title = element_text(size = 30))

sapply(colnames(rtsne_out_RNA_df)[c(4,5,9:30)], function(var){
  print(ggplot(rtsne_out_RNA_df, aes(V1, V2)) +
          geom_point(aes_string(color=var), size=3) +
    scale_color_manual(values = c("#92c5de", "#f4a582",  "grey"))  + 
          ggtitle(gsub("SNPs_", "", gsub("chrom_abber_", "", gsub( "health_record_bin_", "", var) ))) +
      pp_sra_noguides +
      theme(aspect.ratio=1, plot.title = element_text(size = 30)) )
})

##             gender  treatment_status SNPs_ATM SNPs_BIRC3 SNPs_EGR2 SNPs_NOTCH1
## data        List,30 List,30          List,30  List,30    List,30   List,30    
## layers      List,1  List,1           List,1   List,1     List,1    List,1     
## scales      ?       ?                ?        ?          ?         ?          
## mapping     List,2  List,2           List,2   List,2     List,2    List,2     
## theme       List,66 List,66          List,66  List,66    List,66   List,66    
## coordinates ?       ?                ?        ?          ?         ?          
## facet       ?       ?                ?        ?          ?         ?          
## plot_env    ?       ?                ?        ?          ?         ?          
## labels      List,4  List,4           List,4   List,4     List,4    List,4     
## guides      List,4  List,4           List,4   List,4     List,4    List,4     
##             SNPs_POT1 SNPs_SF3B1 SNPs_TP53 SNPs_XPO1 chrom_abber_del11q
## data        List,30   List,30    List,30   List,30   List,30           
## layers      List,1    List,1     List,1    List,1    List,1            
## scales      ?         ?          ?         ?         ?                 
## mapping     List,2    List,2     List,2    List,2    List,2            
## theme       List,66   List,66    List,66   List,66   List,66           
## coordinates ?         ?          ?         ?         ?                 
## facet       ?         ?          ?         ?         ?                 
## plot_env    ?         ?          ?         ?         ?                 
## labels      List,4    List,4     List,4    List,4    List,4            
## guides      List,4    List,4     List,4    List,4    List,4            
##             chrom_abber_del13q14 chrom_abber_del17p13 chrom_abber_del5_IgH
## data        List,30              List,30              List,30             
## layers      List,1               List,1               List,1              
## scales      ?                    ?                    ?                   
## mapping     List,2               List,2               List,2              
## theme       List,66              List,66              List,66             
## coordinates ?                    ?                    ?                   
## facet       ?                    ?                    ?                   
## plot_env    ?                    ?                    ?                   
## labels      List,4               List,4               List,4              
## guides      List,4               List,4               List,4              
##             chrom_abber_delIgH_break chrom_abber_gain14q32 chrom_abber_gain8q24
## data        List,30                  List,30               List,30             
## layers      List,1                   List,1                List,1              
## scales      ?                        ?                     ?                   
## mapping     List,2                   List,2                List,2              
## theme       List,66                  List,66               List,66             
## coordinates ?                        ?                     ?                   
## facet       ?                        ?                     ?                   
## plot_env    ?                        ?                     ?                   
## labels      List,4                   List,4                List,4              
## guides      List,4                   List,4                List,4              
##             chrom_abber_trisomy12 health_record_bin_elderly_at_diagnosis
## data        List,30               List,30                               
## layers      List,1                List,1                                
## scales      ?                     ?                                     
## mapping     List,2                List,2                                
## theme       List,66               List,66                               
## coordinates ?                     ?                                     
## facet       ?                     ?                                     
## plot_env    ?                     ?                                     
## labels      List,4                List,4                                
## guides      List,4                List,4                                
##             health_record_bin_elderly_patient health_record_bin_gender_binary
## data        List,30                           List,30                        
## layers      List,1                            List,1                         
## scales      ?                                 ?                              
## mapping     List,2                            List,2                         
## theme       List,66                           List,66                        
## coordinates ?                                 ?                              
## facet       ?                                 ?                              
## plot_env    ?                                 ?                              
## labels      List,4                            List,4                         
## guides      List,4                            List,4                         
##             health_record_bin_IGHV_mutated
## data        List,30                       
## layers      List,1                        
## scales      ?                             
## mapping     List,2                        
## theme       List,66                       
## coordinates ?                             
## facet       ?                             
## plot_env    ?                             
## labels      List,4                        
## guides      List,4                        
##             health_record_bin_komplex_abberant_karyotype
## data        List,30                                     
## layers      List,1                                      
## scales      ?                                           
## mapping     List,2                                      
## theme       List,66                                     
## coordinates ?                                           
## facet       ?                                           
## plot_env    ?                                           
## labels      List,4                                      
## guides      List,4                                      
##             health_record_bin_treated
## data        List,30                  
## layers      List,1                   
## scales      ?                        
## mapping     List,2                   
## theme       List,66                  
## coordinates ?                        
## facet       ?                        
## plot_env    ?                        
## labels      List,4                   
## guides      List,4

Session Info

sessionInfo()
## R version 3.5.2 (2018-12-20)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Mojave 10.14.6
## 
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
##  [1] grid      parallel  stats4    stats     graphics  grDevices utils    
##  [8] datasets  methods   base     
## 
## other attached packages:
##  [1] viridis_0.5.1               viridisLite_0.3.0          
##  [3] cowplot_1.0.0               survminer_0.4.6            
##  [5] ConsensusClusterPlus_1.46.0 RColorBrewer_1.1-2         
##  [7] gplots_3.0.1.1              PMA_1.1                    
##  [9] MultiAssayExperiment_1.8.3  biomaRt_2.38.0             
## [11] biomartr_0.9.0              Rtsne_0.15                 
## [13] IHW_1.10.1                  apeglm_1.4.2               
## [15] limma_3.38.3                fdrtool_1.2.15             
## [17] vsn_3.50.0                  forcats_0.4.0              
## [19] stringr_1.4.0               dplyr_0.8.3                
## [21] purrr_0.3.3                 readr_1.3.1                
## [23] tidyr_1.0.0                 tibble_2.1.3               
## [25] tidyverse_1.3.0             TOSTER_0.3.4               
## [27] DESeq2_1.22.2               SummarizedExperiment_1.12.0
## [29] DelayedArray_0.8.0          BiocParallel_1.16.6        
## [31] matrixStats_0.55.0          Biobase_2.42.0             
## [33] GenomicRanges_1.34.0        GenomeInfoDb_1.18.2        
## [35] IRanges_2.16.0              S4Vectors_0.20.1           
## [37] BiocGenerics_0.28.0         readxl_1.3.1               
## [39] ggrepel_0.8.1               ggpmisc_0.3.3              
## [41] ggfortify_0.4.8             ggbeeswarm_0.6.0           
## [43] effsize_0.7.6               ggpubr_0.2.4               
## [45] magrittr_1.5                lemon_0.4.3                
## [47] Hmisc_4.3-0                 ggplot2_3.2.1              
## [49] Formula_1.2-3               survival_3.1-8             
## [51] lattice_0.20-38             Matrix_1.2-18              
## [53] progress_1.2.2              reshape2_1.4.3             
## [55] pheatmap_1.0.12             openxlsx_4.1.4             
## [57] gtools_3.8.1                plyr_1.8.4                 
## 
## loaded via a namespace (and not attached):
##   [1] tidyselect_0.2.5       RSQLite_2.1.4          AnnotationDbi_1.44.0  
##   [4] htmlwidgets_1.5.1      munsell_0.5.0          codetools_0.2-16      
##   [7] preprocessCore_1.44.0  withr_2.1.2            colorspace_1.4-1      
##  [10] knitr_1.26             rstudioapi_0.10        ggsignif_0.6.0        
##  [13] labeling_0.3           slam_0.1-46            bbmle_1.0.20          
##  [16] GenomeInfoDbData_1.2.0 lpsymphony_1.10.0      KMsurv_0.1-5          
##  [19] farver_2.0.1           bit64_0.9-7            coda_0.19-3           
##  [22] vctrs_0.2.0            generics_0.0.2         xfun_0.11             
##  [25] R6_2.4.1               locfit_1.5-9.1         bitops_1.0-6          
##  [28] assertthat_0.2.1       scales_1.1.0           nnet_7.3-12           
##  [31] beeswarm_0.2.3         gtable_0.3.0           affy_1.60.0           
##  [34] rlang_0.4.2            zeallot_0.1.0          genefilter_1.64.0     
##  [37] splines_3.5.2          lazyeval_0.2.2         acepack_1.4.1         
##  [40] impute_1.56.0          broom_0.5.2            checkmate_1.9.4       
##  [43] BiocManager_1.30.10    yaml_2.2.0             modelr_0.1.5          
##  [46] backports_1.1.5        tools_3.5.2            affyio_1.52.0         
##  [49] ellipsis_0.3.0         Rcpp_1.0.3             base64enc_0.1-3       
##  [52] zlibbioc_1.28.0        RCurl_1.95-4.12        prettyunits_1.0.2     
##  [55] rpart_4.1-15           zoo_1.8-6              haven_2.2.0           
##  [58] cluster_2.1.0          fs_1.3.1               data.table_1.12.8     
##  [61] reprex_0.3.0           hms_0.5.2              evaluate_0.14         
##  [64] xtable_1.8-4           XML_3.98-1.20          emdbook_1.3.11        
##  [67] gridExtra_2.3          compiler_3.5.2         KernSmooth_2.23-16    
##  [70] crayon_1.3.4           htmltools_0.4.0        geneplotter_1.60.0    
##  [73] lubridate_1.7.4        DBI_1.0.0              dbplyr_1.4.2          
##  [76] MASS_7.3-51.4          cli_2.0.0              gdata_2.18.0          
##  [79] pkgconfig_2.0.3        km.ci_0.5-2            numDeriv_2016.8-1.1   
##  [82] foreign_0.8-72         xml2_1.2.2             annotate_1.60.1       
##  [85] vipor_0.4.5            XVector_0.22.0         rvest_0.3.5           
##  [88] digest_0.6.23          Biostrings_2.50.2      rmarkdown_1.18        
##  [91] cellranger_1.1.0       survMisc_0.5.5         htmlTable_1.13.3      
##  [94] curl_4.3               lifecycle_0.1.0        nlme_3.1-142          
##  [97] jsonlite_1.6           fansi_0.4.0            pillar_1.4.2          
## [100] httr_1.4.1             glue_1.3.1             zip_2.0.4             
## [103] bit_1.1-14             stringi_1.4.3          blob_1.2.0            
## [106] latticeExtra_0.6-28    caTools_1.17.1.3       memoise_1.1.0